package com.yanqu.road.entity.activity;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

@FieldTypeAnnotation(tableName = "t_u_activity_mall_day_buy")
public class ServerActivityMallDayBuyData extends DataObject {
    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "礼包id", update = true)
    private int mallId;
    @FieldTypeAnnotation(desc = "天数", update = true)
    private int day;
    @FieldTypeAnnotation(desc = "玩家Id", update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "个人购买数量")
    private int buyCount;
    @FieldTypeAnnotation(desc = "领取奖励的id列表")
    private Set<Integer> awardConditionIdList = new HashSet<>();     // 领取的条件id列表

    public ServerActivityMallDayBuyData() {
    }

    public ServerActivityMallDayBuyData(int activityId, int mallId, int day, long userId) {
        this.activityId = activityId;
        this.mallId = mallId;
        this.day = day;
        this.userId = userId;
        setInsertOption();
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getMallId() {
        return mallId;
    }

    public void setMallId(int mallId) {
        this.mallId = mallId;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public int getBuyCount() {
        return buyCount;
    }

    public void setBuyCount(int buyCount) {
        this.buyCount = buyCount;
        setUpdateOption();
    }

    public Set<Integer> getAwardConditionIdList() {
        return awardConditionIdList;
    }

    public void setAwardConditionIdList(Set<Integer> awardConditionIdList) {
        this.awardConditionIdList = awardConditionIdList;
        setUpdateOption();
    }

    public void addBuyNum() {
        this.buyCount++;
        setUpdateOption();
    }

    public void addAwardConditionId(int conditionId) {
        this.awardConditionIdList.add(conditionId);
        setUpdateOption();
    }
}
